﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ControlNhapSoLieuTuNPPNMD.ascx.cs" Inherits="UserControl_ControlNhapSoLieuTuNPPNMD" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPopupControl" tagprefix="dxpc" %>
<%@ Import Namespace="webapp4U" %>



    <script type="text/javascript" src="<%=Globals.ApplicationPath%>JScript/jquery.uploadify.js"></script>
    <script type = "text/javascript">
        function pageLoad() {

            $("#<%= btnDelete.ClientID %>").click(function () {
                $.blockUI({ css: {
                    border: 'none',
                    padding: '15px',
                    backgroundColor: '#000',
                    '-webkit-border-radius': '10px',
                    '-moz-border-radius': '10px',
                    opacity: .5,
                    color: '#fff'
                }
                });
        });
        $("#<%= btnView.ClientID %>").click(function () {
            $.blockUI({ css: {
                border: 'none',
                padding: '15px',
                backgroundColor: '#000',
                '-webkit-border-radius': '10px',
                '-moz-border-radius': '10px',
                opacity: .5,
                color: '#fff'
            }
            });
        });
        $("#<%= btnSave.ClientID %>").click(function () {
            $.blockUI({ css: {
                border: 'none',
                padding: '15px',
                backgroundColor: '#000',
                '-webkit-border-radius': '10px',
                '-moz-border-radius': '10px',
                opacity: .5,
                color: '#fff'
            }
            });
        });

                $("#<%=FileUpload1.ClientID %>").fileUpload({
                    'uploader': '<%=ResolveUrl("~/JScript/uploader.swf")%>',
                    'cancelImg': '<%=ResolveUrl("~/Images/cancel.png")%>',
                    'buttonText': 'Browse Files',
                    'script': '<%=ResolveUrl("~/ASHX/Upload.ashx")%>',
                    'folder': '<%=ResolveUrl("~/UserUpload/UploadTempFileExcel")%>',
                    'fileDesc': 'Excel Files',
                    'fileExt': '*.xls;*.xlsx',
                    'multi': false,
                    'auto': true,
                    'onComplete': function(a, b, c, d, e) {
                        if (d !== '1') {
                            $('#<%= txtFileName.ClientID %>').val(d);
                            $('#<%= lblFileName.ClientID %>').html(d);
                        }
                    }
                });
                Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
                function EndRequestHandler(sender, args) {
                    $.unblockUI();
                }

        }
    </script> 

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
     <div class="direct_container_right_titletop">
                    Cập nhật số liệu từ NPP NMD.
                </div>
            <cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" 
            BackColor="#CCFFFF" Font-Names="Arial" 
            Width="100%">
            <cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="Thông tin upload số liệu của nhà cung cấp" TabIndex="0">
                 <ContentTemplate>
                     <!-- Content main-->
                <div class="direct_container_main">
                    <div class="direct_container_form_right">
                        <table border="0" width="100%">
                        
                            <tr>
                                <td colspan="4" align="center">
                                    <asp:Label ID="lblMsg" runat="server" Visible="false" BackColor="Silver" ForeColor="Blue" Font-Bold="true" Font-Italic="true"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td width="14%" align="right"><p class="direct_label">Tiêu đề: </p></td>
                                <td width="86%" align="left">                               
                                    <asp:TextBox ID="txtTitle" runat="server"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" Display="Dynamic" ControlToValidate="txtTitle" ErrorMessage="Tiêu đề không được rỗng"></asp:RequiredFieldValidator>
                                </td>
                            </tr>                           
                            <tr>
                                <td width="14%" align="right"><p class="direct_label">Upload File</p></td>
                                <td width="86%" align="left">                               
                                       
                                    <asp:FileUpload ID="FileUpload1" runat="server" />
                                       
                                </td>
                            </tr>                    
                            
                             <tr>
                                <td align="right"><p class="direct_label">Tên file</p></td>
                                <td align="left">
                                    <asp:HiddenField ID="txtFileName" runat="server" />
                                    <asp:Label ID="lblFileName" runat="server" Text=""></asp:Label>
                                    
                                </td>
                            </tr>
                            <tr>
                                <td align="right"><p class="direct_label"></p></td>
                                <td align="left">
                                    <asp:Button ID="btnDelete" runat="server" Text="Xóa" CausesValidation="false" onclick="btnDelete_Click"/>
                                    <asp:Button ID="btnView" runat="server" Text="Xem" CausesValidation="false" onclick="btnView_Click"/>
                                    <asp:Button ID="btnSave" runat="server" Text="Import dữ liệu" CausesValidation="true" onclick="btnSave_Click"/>                                    
                                </td>
                            </tr>

                        </table>
                        
                        <div style="overflow:auto; width:100%">
                            <asp:GridView ID="gviewList" runat="server" AllowPaging="True" PageSize="15">
                            </asp:GridView>
                        </div>
                    </div>
                </div>
                
                <!-- EndContent main-->
                 </ContentTemplate>
            </cc1:TabPanel>             
            </cc1:TabContainer>       
            
            <dxpc:ASPxPopupControl ID="MessageBox" PopupHorizontalAlign="WindowCenter"  PopupVerticalAlign="WindowCenter" Font-Bold="true" HeaderText="Xác nhận" 
            runat="server" Height="91px" Width="601px" Modal="True" CloseAction="CloseButton" ClientInstanceName="popupControl">
                
                <ContentCollection>
                    <dxpc:PopupControlContentControl ID="PopupControlContentControl1" runat="server" SupportsDisabledAttribute="True">
                        <table width="100%">
                            <tr>
                                <td>
                                    <asp:Label ID="lblMessageBox" runat="server" Text=""></asp:Label>
                                </td>
                            </tr>                            
                        </table>                        
                    </dxpc:PopupControlContentControl>                
                </ContentCollection>
            </dxpc:ASPxPopupControl>     
    </ContentTemplate>
</asp:UpdatePanel>
